package com.sc.nft.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.ReportBalance;
import com.sc.nft.entity.vo.ReportAmountVO;
import com.sc.nft.entity.vo.TotalReportAmountVO;
import lombok.extern.slf4j.Slf4j;
import com.sc.nft.entity.ReportAmount;
import com.sc.nft.mapper.ReportAmountMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * (sc_report_amount)数据DAO
 *
 * @author Sun
 * @since 2023-02-20 14:10:29
 * @description 由 Mybatisplus Code Generator 创建
 */
@Slf4j
@Repository
public class ReportAmountDao extends ServiceImpl<ReportAmountMapper, ReportAmount> {

    public Boolean getByTime(String time) {
        List<ReportBalance> list = baseMapper.getByTime(time);
        if(list.size() >0){
            return Boolean.TRUE;
        }
        return Boolean.FALSE;
    }

    public Page<ReportAmountVO> getPageReportAmount(String beginTime, String endTime, Integer pageNo, Integer pageSize) {
        return baseMapper.getPageReportAmount(new Page<>(pageNo,pageSize),beginTime,endTime);
    }

    public TotalReportAmountVO getTotalReportAmount(String beginTime, String endTime) {
        return baseMapper.getTotalReportAmount(beginTime,endTime);
    }
}